feat: editor layout redesign v2 + 3D box select#207
Merged
open-pascal merged 7 commits intomainfrom Apr 2, 2026
Merged
Conversation
New v2 layout with navbar + two-column structure: - Resizable left sidebar with horizontal tab bar - Right viewer panel with floating toolbar slots - Floating level selector on viewer panel - 3D box select tool with marquee selection - View mode system (3D/2D/Split) replacing old floorplan toggle - Fixed 5-button control bar: Select, Box Select, Site Edit, Build, Delete - Simplified view toggles (scans/guides only) - Always-mounted viewers (display:none) to preserve WebGL context - Floorplan top toolbar removed, controls moved to viewer toolbar - Site edit as permanent peer in ControlModes (phase='site' is sole signal) - Site edge labels respect metric/imperial unit toggle
Add ViewerToolbarLeft and ViewerToolbarRight components: - 3D/2D/Split view mode segmented control - Collapse sidebar button - Level mode toggle (stacked/exploded/solo) - Wall mode toggle (cutaway/full height/low) - Measurement unit toggle (metric/imperial) - Day/night theme toggle - Perspective/orthographic camera toggle - Walkthrough (first-person) mode - Preview mode button Wire up toolbar in the v2 layout app page.
- Add isCollapsed/setIsCollapsed to useSidebarStore (was missing from editor repo, present in upstream) — fixes CollapseSidebarButton crash - Add collapse threshold logic to setWidth - Restore isFirstPersonMode/setFirstPersonMode to editor store — was removed when syncing use-editor.tsx but still needed by custom-camera-controls and viewer toolbar walkthrough button - Forces perspective camera + full-height walls when entering first-person mode
- Import and render FirstPersonControls inside the Viewer scene - Add FirstPersonOverlay with exit button when in first-person mode - Switch Viewer to selectionManager='default' during first-person mode - Conditionally hide editor tools (selection, box select, grid, tool manager, site edge labels) during walkthrough - Show ViewerZoneSystem + InteractiveSystem during first-person mode - Hide camera controls hint during walkthrough - V2 layout enters full-screen walkthrough view (same as preview mode but with FirstPersonControls instead of orbit)
When entering first-person mode from split or 2D view: - Save current viewMode before switching - Force viewMode to '3d' and close floorplan - On exit, restore the previous viewMode (split/2d/3d)
Instead of swapping between EditorLayoutV2 and a full-screen walkthrough view (which unmounts/remounts the Three.js canvas, causing material traversal errors), keep the v2 layout always mounted and overlay the FirstPersonOverlay on top via fixed positioning. The viewMode: '3d' state change already hides the 2D pane, and the conditional rendering in viewerSceneContent disables editor tools. The overlay provides the crosshair, controls hint, and exit button.
The FirstPersonOverlay wrapper div had pointer-events-auto on the full area, blocking clicks from reaching the Three.js canvas and preventing pointer lock activation. Now only the exit button and crosshair/hint elements have their own pointer-events settings — the rest passes through to the canvas so clicking activates mouse look.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Major layout redesign introducing v2 editor layout with a modern two-column structure.
New Features
Layout Changes
siteis the sole signal)Technical
layoutVersionprop on Editor:'v1'(default, backward compat) or'v2'display:noneinstead of unmount — preserves WebGL context across view switchesFloatingLevelSelector,SettingsPanel,SidebarTab,ViewMode,SplitOrientation,FloorplanSelectionTool,useSidebarStoreFiles Changed
17 files, +2821/-1896
Built and verified:
bun run buildpasses cleanly (all 3 turbo tasks successful, 0 errors).